<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<?php include_http_metas() ?>
		<?php include_metas() ?>
		<?php include_title() ?>
		<link rel="shortcut icon" href="/favicon.ico" />
		<?php include_stylesheets() ?>
	    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
	    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.min.js"></script>
	    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/i18n/jquery.ui.datepicker-pt-BR.js"></script>
	    <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/base/jquery-ui.css" type="text/css" />
        <script type="text/javascript" src="<?php echo $sf_context->getRequest()->getRelativeUrlRoot(); ?>/js/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
        <script type="text/javascript">var BASEURL = "<?php echo $sf_context->getRequest()->getRelativeUrlRoot(); ?>";</script>
	</head>
<body>
<?php if($sf_user->isAuthenticated()): ?>
	<div id="topo">
		<div id="header">
			<div id="logo" >
				<?php 
					echo image_tag(
				 	'topo_gerenciador.png',
				 	array(
				 		'alt' => 'Gerenciador'
				 	)
			);
				?>
			</div>
			<div style="padding:20px 0px 20px 5px;">
				<?php echo sfConfig::get('app_titulo_aplicacao'); ?>
			</div>
			<div id="module_menu" >
				
				<div style="float: right; padding-right: 15px; font-size:13px;">
					<b>Usuario</b>: <?php echo $sf_user->getAttribute('username', null, 'sfGuardSecurityUser'); ?>
				</div>
				
				<div id='menu'></div>
	    		<div class="clr"></div>
			</div>
		</div>
	</div>
	<div id="geral">
	<?php endif; ?>
	<!-- Message -->
	<div id="mensagens">
	<?php if ($sf_user->getFlash('orientacao')): ?>
		<div class="msgOrientacao">
				<h3>Orienta&ccedil;&atilde;o</h3>
				<?php echo $sf_user->getFlash('orientacao') ?>
		</div>
	<?php endif; ?>	
	<?php if ($sf_user->getFlash('mensagem')): ?>
		<div class="msgSucesso">
			<h3>Sucesso</h3>
			<?php echo $sf_user->getFlash('mensagem') ?>
		</div>
	<?php endif; ?>
	<?php if ($sf_user->getFlash('alert')): ?>
		<div class="msgAlerta">
			<h3>Aten&ccedil;&atilde;o</h3>
			<?php echo $sf_user->getFlash('alert') ?>
		</div>
	<?php endif; ?>
	<?php if ($sf_user->getFlash('erro')): ?>
		<div class="msgErro">
			<h3>Erro</h3>
			<?php echo $sf_user->getFlash('erro') ?>
		</div>
	<?php endif; ?>
	</div>
	<?php if (has_slot('mensagens')): ?>
		<?php include_slot('mensagens') ?>
	<?php endif; ?>
	
	<div id="conteudo">
		<?php echo $sf_content ?>
		<div class="clr"></div>
	</div>
	<div id="rodape"></div>
</div>
<div id='modal-content' style="display: none;"></div>
	<?php 
	    echo javascript_tag("
        	var cmThemeOfficeBase = '" . $sf_context->getRequest()->getRelativeUrlRoot() . "/images/ThemeOffice/';
        ");
    ?>
    
	<?php include_javascripts(); ?>
	
	<?php 
	    if($sf_user->isAuthenticated()) {
	    	
    	    $menu = new sfFoxsisMenu($sf_user, 'menu');
            echo $menu->render();
	    }
	?>
</body>
</html>